<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>07.文字聚光灯</title>
  <style>
     body {
      background-color: #333;
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
     }
     h1 {
    
      color: #999;
      font-family: Arial, Helvetica, sans-serif;
      margin: 0;
      padding: 0;
      font-size: 4rem;
      position: relative;
     }
     h1::after {
      content: attr(data-text);
      position: absolute;
      width: 100%;
      left: 0;
      top: 0;
      text-align: center;
      color: transparent;
      /* clip-path: circle(50px at 0 50%); */
      background-image:linear-gradient(
        to right,
        #ff0000 25%,
        #ffff00 30%,
        #0f0 50%,
        #0aeafa 70%,
        #00f 90%
      );
      background-clip: text;
      animation: clip-move 4s infinite;
     }
     @keyframes clip-move {
      0% {
        clip-path: circle(50px at 6% 50%);
      }
      50% {
        clip-path: circle(50px at 91% 50%);
      }
      100% {
        clip-path: circle(50px at 6% 50%);
      }
     }
  </style>
</head>
<body>
  <h1 data-text="Hello World!">Hello World!</h1>
</body>
</html>